package cn.iocoder.yudao.module.dbit.controller.admin.stumst;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.dbit.controller.admin.stumst.vo.StuMstRespVO;
import cn.iocoder.yudao.module.dbit.service.stumst.StuMstService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @ClassName StuMstController
 * @Author wzy
 * @qq交流 3116465773
 * @Description TODO
 */
@RestController
@RequestMapping("/dbit/stu-mst")
@Validated
public class StuMstController {


    private static final Logger log = LoggerFactory.getLogger(StuMstController.class);
    @Resource
    private StuMstService service;

    @GetMapping("/get")
    @Operation(summary = "获得学生信息")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    public CommonResult<StuMstRespVO> getStuMst(@RequestParam("id") Long id) {
        StuMstRespVO result = service.getStuMstInfo(id);
        return success(result);
    }

    @PutMapping("/update")
    @Operation(summary = "更新学生信息")
    public CommonResult<Boolean> updateStuMstInfo(@Valid @RequestBody StuMstRespVO updateReqVO) {
        service.updateStuMstInfo(updateReqVO);
        return success(true);
    }
}
